package com.lemon.cloud.admin.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotEmpty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import java.io.Serializable;

@Data
@Schema
public class OAuthClientDTO implements Serializable {

    @NotEmpty(message = "编码不能为空")
    @Length(min = 2, max = 50, message = "编码长度在2~50字符")
    @Schema(description = "客户端编码", minLength = 2, maxLength = 50)
    private String clientId;

    private String resourceIds;

    @NotEmpty(message = "密钥不能为空")
    @Length(min = 2, max = 50, message = "密钥长度在2~50字符")
    @Schema(description = "密钥", minLength = 2, maxLength = 50)
    private String clientSecret;

    @NotEmpty(message = "域不能为空")
    @Length(min = 2, max = 50, message = "域长度在2~50字符")
    @Schema(description = "域", minLength = 2, maxLength = 50)
    private String scope;

    @NotEmpty(message = "授权模式不能为空")
    @Length(min = 2, max = 500, message = "授权模式长度在2~200字符")
    @Schema(description = "授权模式", minLength = 2, maxLength = 50)
    private String authorizedGrantTypes;

    @Schema(description = "web重定向页面")
    private String webServerRedirectUri;

    @Schema(description = "权限")
    private String authorities;

    @Schema(description = "token有效期")
    private Integer accessTokenValidity;

    @Schema(description = "refresh_token有效期")
    private Integer refreshTokenValidity;

    @Schema(description = "额外属性")
    private String additionalInformation;

    @NotEmpty(message = "自动放行不能为空")
    @Schema(description = "自动放行", minLength = 2, maxLength = 50)
    private String autoapprove;

}
